package com.doyoulearn.websocket.controller;

import com.doyoulearn.websocket.dto.WebAlarmSocketMessage;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

//@Controller
public class WebAlarmControllerV1 {

    @MessageMapping("/web/alarm/in")
    @SendTo("/web/alarm/out")
    public WebAlarmSocketMessage alarm(String userId) {
        System.err.println("userId:" + userId);
        WebAlarmSocketMessage result = new WebAlarmSocketMessage();
        result.setAlarm(userId);
        return result;
    }


}
